﻿@{
    ViewData["Title"] = "添加参数";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
<div class="layui-bg">
    <form class="layui-form" style="padding: 20px 30px 0 0;">
        <div class="layui-form-item">
            <label class="layui-form-label">参数名称</label>
            <div class="layui-input-block">
                <input type="text" name="KeyName" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">参数值</label>
            <div class="layui-input-block">
                <input type="text" name="KeyValue" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">业务类型</label>
            <div class="layui-input-block">
                <select name="KeyType" asp-items="@ViewBag.Types"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">参数描述</label>
            <div class="layui-input-block">
                <textarea name="Description" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="add" id="submit" type="button">提交</button>
                <button id="close" type="button" class="layui-btn layui-btn-primary">关闭</button>
            </div>
        </div>
    </form>
</div>
    @section scriptsfeet
        {
        <script type="text/javascript">
        layui.config({
            base: '/layuiadmin/' //自定义模块路径
        }).use(['form', 'layer', 'sykjwh'], function () {
            var $ = layui.$, form = layui.form, sykjwh = layui.sykjwh;

            $("#close").click(function () {
                sykjwh.close();
            });

            form.on('submit(add)', function (obj) {
                //保存
                sykjwh.save('@Url.Action("add", "config", new { area = Constant.AREAMANAGER })', obj.field);
            });
        });
        </script>
    }
